<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="box">
        div的文本内容
        <p>div里面的p的文本内容</p>
    </div>
    
    <script>
        // 直接赋值，会将原内容覆盖
        // box.innerText = "你好";
        // console.log(box.innerText);

        // box.innerText = box.innerText + "你好"

        // box.innerText = "<h1>你好</h1>"

        console.log(box.innerHTML);
        box.innerHTML += "<div></div>"
        



    </script>
</body>

</html>